<?php
if (!defined('BASEPATH'))
	exit('No direct script access allowed');

class Listings extends MX_Controller {

	public function __construct() {
		parent::__construct();
		$this->load->model(array('admin_commoncall','admin_settings_model','admin_listing_model','admin_location_model','admin_category_tree_model','admin_member_model','admin_counter_model'));
		$this->load->library('pagination');
		$this->admin_commoncall->check_admin_login();
		$this->template->set_theme('admin');
		$this->template->set_layout('default');
		//$this->template->set_partial('side_menu','layouts/side_menu');
		//$this->template->set_partial('nav_bar','layouts/nav_bar');

	}

	function index()
	{
		//-- Default Value --//



		$status=1;
		$featured=false;
		$search = "";

		if($this->input->post('filter')){
			$filter = $this->input->post('filter');

			switch ($filter) {
				case 'active':
					$status = 51;
					break;
				case 'inactive':
					$status = 1;
					break;
				case 'featured':
					$status = 51;
					$featured=true;
					break;
			}
		}

		$data['listing']['all'] = $this->admin_listing_model->get_listings($status = $status);

		if($this->input->post('search')){
			$search = 	trim($this->input->post('search'));
			$data['listing']['all'] = $this->admin_listing_model->search($search = $search);
			//print $search;
		}

		$this->template->title('Welcome', 'Ypage.com')
		->set_partial('nav_bar','layouts/nav_bar')
		->set_partial('side_menu','layouts/side_menu')
		->set_partial('footer','footer/footer')
		->build('listing/report',$data);
	}

	
	function action()
	{
		$status=NULL;
		$id=NULL;

		if($this->input->post('action')){
			$action = $this->input->post('action');
			$id = $this->input->post('listing_id');

			switch ($action) {
				case 'active':
					$status = 51;

					$this->admin_listing_model->change_status($status,$id);

					break;
				case 'inactive':
					$status = 1;
					$this->admin_listing_model->change_status($status,$id);
					break;
				case 'delete':
					$this->admin_listing_model->delete($id);
					break;

				case 'edit':

					$url= 'secure/listing/listings/edit/'.$id;
					redirect($url);
					break;


			}
		}

		redirect('secure/listing/listings');
	}

	function change_business_status($status=NULL,$id=NULL) {
		$this->admin_listing_model->change_status($id, $status);
		redirect('secure/listing/listings');
	}

	function delete_business($id){
		$this->admin_listing_model->delete($id);
		redirect('secure/listing/listings');
	}

	function add(){
		$data['mode'] = "new";

		$data['state']= $this->admin_location_model->get_states(99999);
		$data['keyword']=  $this->admin_category_tree_model->get_cetegory();

		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
		$this->template->build('listing/add_new_listing',$data);
	}

	function edit($id){

		//die("jkhkj");
		$data['mode'] = "edit";
		$data['listing']['info']= $this->admin_listing_model->getListing($id);


		$data['speciality'] = $this->admin_listing_model->getSpecialities();

		$data['payment'] = $this->admin_listing_model->getPayment($data['listing']['info']->id);

		$data['state'] = $this->admin_listing_model->getStates();

		//	$data['city']= $this->admin_location_model->get_city($data['listing']['info']->state);


		$data['state']['info']= $this->admin_location_model->get_statess(99999);

		//$data['parent']=  $this->admin_category_tree_model->get_parent();

		$data['listing_id'] = $id;


		//$data['keywords']=  $this->admin_category_tree_model->get_keyword_category();


		$data['city']['info']= $this->admin_location_model->get_cityy($data['listing']['info']->state);


		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
		$this->template->build('listing/add_new_listing',$data);
	}

function submit($mode="new",$id=0){

		$this->form_validation->set_rules('title', 'Lawyer/Lawfirm Name', 'trim|required|xss_clean');
		$this->form_validation->set_rules('speciality[]', 'Speciality/Expertization', 'trim|required');
		$this->form_validation->set_rules('payment[]','Payment','trim|xss_clean');
		$this->form_validation->set_rules('state', 'State/Province', 'trim|required');
		$this->form_validation->set_rules('city', 'City/Area', 'trim|required');

		$this->form_validation->set_rules('zip', 'Zip Code', 'trim|required|numeric');
		$this->form_validation->set_rules('address1', 'Address Line 1', 'trim|required|xss_clean');
		$this->form_validation->set_rules('address2', 'Address Line 2', 'trim|xss_clean');
		$this->form_validation->set_rules('phone', 'Phone No (1)', 'trim|required|xss_clean');
		$this->form_validation->set_rules('phone2', 'Phone No (2)', 'trim|xss_clean');
		$this->form_validation->set_rules('fax', 'Fax', 'trim|xss_clean');

		$this->form_validation->set_rules('email', 'Email ID', 'trim|required|valid_email');
		$this->form_validation->set_rules('website', 'Website ', 'trim|xss_clean');

		$this->form_validation->set_rules('language','Language','trim|required|xss_clean');
		$this->form_validation->set_rules('facebook_link','Facebook Link','trim|xss_clean');
		$this->form_validation->set_rules('twitter_link','Twitter Link','trim|xss_clean');
		$this->form_validation->set_rules('google_link','Google Link','trim|xss_clean');
		$this->form_validation->set_rules('linkedin_link','Linkedin Link','trim|xss_clean');

		$this->form_validation->set_rules('language','Language Spoken','trim|xss_clean|required');
		
		$this->form_validation->set_rules('about','About you','trim|xss_clean|required');


		if ($this->form_validation->run() == true) {
			$post_data = array(
					'mem_id' => $this->input->post('mem_id'),
					'title' => trim($this->input->post('title')),
					'state' => intval($this->input->post('state')),
					'city' => intval($this->input->post('city')),
					'zip' => intval($this->input->post('zip')),
					'address1' => trim($this->input->post('address1')),
					'address2' => $this->input->post('address2'),
					'phone1' => $this->input->post('phone'),
					'phone2' => $this->input->post('phone2'),
					'fax' => $this->input->post('fax'),

					'email' => $this->input->post('email'),
					'website' => $this->input->post('website'),
					'language' => $this->input->post('language'),
					'facebook' => $this->input->post('facebook_link'),
					'twitter' => $this->input->post('twitter_link'),
					'googleplus' => $this->input->post('google_link'),
					'linkedin' => $this->input->post('linkedin_link'),
					'consultation' => $this->input->post('consultation'),
					'description' => $this->input->post('about'),
					'featured' => $this->input->post('featured'),
					'verified' => $this->input->post('verified'),
					'lat' => $this->input->post('lat'),
					'long' => $this->input->post('long'),
						
			);


			
			//--Add new business ID in Business Master Table--//
			if($mode == "new"){
				//--Save Data Business Master
				$this->db->insert('profile',$post_data);

				//--Get Latest ID--//
				$bid = $this->_getLastID();

				//--Save Keyword to Listing Keyword
				$keyword = $_POST['speciality'];
				foreach ($keyword as $key=>$value) {

					$post_data= array(
							'listing_id' =>$bid,
							'term_value' => $value,
							'term' => 'key',
							'caption' => 'Keyword'
					);

					$this->db->insert('term',$post_data);
				}
				
				
				//--SAVE PAYMENT MODE to TERM TABLE
				$payment = $_POST['payment'];
				foreach ($payment as $key=>$value) {
						$post_data= array(
								'listing_id' =>$bid,
								'term_value	' => $value,
								'term' => 'payment',
								'caption' => 'Payment'
						);
						$this->db->insert('term',$post_data);
					
				}
				
				$this->session->set_flashdata('message', "Add Successfully");
				redirect('secure/listing/listings/add');


			}



			//--Update Business Listing ID--//

			if($mode == "edit"){
				$this->db->where('id', $id);
				$this->db->update('profile', $post_data);

				//--Delete All Existing--//
				$sql = "Delete from term where listing_id=$id";
				$this->db->query($sql);

				//--Insert  Keyword in Listing Keyword--//

				$keyword = $_POST['speciality'];
				foreach ($keyword as $key=>$value) {

					$post_data= array(
							'listing_id' =>$id,
							'term_value' => $value,
							'term' => 'key',
							'caption' => 'Keyword'
					);


					$this->db->insert('term',$post_data);
				}
				
				
				//--SAVE PAYMENT MODE to TERM TABLE
				$payment['list'] = $this->input->post('payment');
					
					
				$this->db->query("delete from term where listing_id = $id and term='payment'");
					
				if($payment['list']){
					foreach ($payment['list'] as $key=>$value) {
						$post_data= array(
								'listing_id' =>$id,
								'term_value	' => $value,
								'term' => 'payment',
								'caption' => 'Payment'
						);
						$this->db->insert('term',$post_data);
					}
				}
				
				$this->session->set_flashdata('message', "Update Successfully");
				redirect('secure/listing/listings/edit/'. $id);
			}
		}else{
			if($mode =="new"){
				$this->session->set_flashdata('message', "Invalid! Input Please check all the fields are entered correctly..");
				$this->add();
			}
			if($mode =="edit"){
				$this->session->set_flashdata('message', "Invalid! Input Please check all the fields are entered correctly..");
				$this->edit($id);
				//redirect('secure/listing/listings/edit/'. $id);
			}
		}
	}









	//--Get Latest Id from Business master--//
	function _getLastID(){
		//$mem_id = intval($this->session->userdata('mem_id'));
		$sql = "Select max(id) as id from profile";
		$result= $this->db->query($sql)->row();
		if ($result)
		{
			return $result->id;
		}

	}

	public function add_logo($profile_id=0){
		$sql="select photo from profile where id=$profile_id";
		$query = $this->db->query($sql);
		if ($query->num_rows() > 0) {
			$row = $query->row();

		}

		$data['profile_id'] = $profile_id;

		$data['photo']=$row->photo;


		//$data['facilities'] = $this->listing_model->membership_facility($listing_id,'logo' );
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');

		$this->template->build('listing/logo',$data);
	}



	function upload_logo($profile_id=0)
	{
	if ($this->input->post('upload')) {

		$profile_id = $_POST['profile_id'];

		$filevariable=array_keys($_FILES);
		$userfile=$filevariable[0];
		$image=$_FILES[$userfile];

		//$vSize = $this->input->post('banner_size');
		//$vSize = explode('X',$vSize);
		//$vH=0;
		//$vW=0;

		//$vW=$vSize[0];
		//$vH=$vSize[1];


		$imageData=array(
				'userfile'=>$userfile,
				'imagearray'=>$image,
				'imagepath'=>'./assets/images/photo/',
				'allowedtype'=>'jpg|png|gif|jpeg',
				'overwrite'=>'true',
				'removespace'=>'true',
				'customefilename'=>'',     		//do not use extension if not need leave blank
				'namewithtime'=>'yes', 			//time(image_121326.jpg)at last of file name if not need leave blank
				'separator'=>'-', 				//format - image_121326.jpg (.)not allowed, if not require leave blank
				'prefix'=>'lawyer_',				//format my_image_121326.jpg , if not require leave blank
				'errmessage'=>'',               // If blank default message will shown
				'sucessmessage'=>'',            // If blank default message will shown
				'createthumb'=>'no',
				//'thumbwidth'=>$vW,
				//'thumbheight'=>$vH,
				'thumbpath'=>'' 				// Dont write thumb folder name in path

		);

		$uploadData=$this->commoncall->upload($imageData);

		//print_r($uploadData);
		//die();


		$id = $this->input->post('profile_id');

		$data=array(

				//'id'=>$listing_id,
				'photo'=>$uploadData['data'],

		);

		if ($uploadData['data']  == TRUE ) {


			$image = $this->admin_listing_model->tutorial_image($profile_id);

			if ($image->photo != 'noimage2.jpg') {
				$f = BASEPATH.'../assets/images/photo/' . $image->photo;
				unlink($f);
			}

			/*$sql = "Select logo from business_master where id= $id";
			 $filename = $this->db->query($sql)->row()->logo;
			$f = BASEPATH.'../assets/images/data/logo/'.$filename;
			unlink($f);
			*/

			$this->db->where('id', $id);
			$this->db->update('profile',$data);
			$this->session->set_flashdata('message', 'Image Uploded Sucessfully!... ');
			redirect('secure/listing/listings/add_logo/'.$profile_id);
				
		} else {
				
			$this->session->set_flashdata('message', 'Fields can not be null!... ');
			redirect('secure/listing/listings/add_logo/'.$profile_id);
			exit();

		}
	} else {

		$this->session->set_flashdata('message', 'Please Choose a correct file!... ');
		redirect('secure/listing/listings/add_logo/'.$profile_id);
		exit();

	}

	}
	
	
	
	function add_qualification($profile_id=0)
	{
		$data['mode'] = "ADD";
		
		$data['qualification'] = $this->admin_listing_model->getQualification($profile_id);
		
		$data['profile_id'] = $profile_id;
		
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
		
		$this->template->build('listing/qualification',$data);
		
	}
	
	function edit_qualification($id)
	{
	
			
		$data['mode'] = "EDIT";
		
		$data['qualification']['info'] = $this->admin_listing_model->getQualificationinof($id);
	
		//$data['profile_id'] = $profile_id;
	
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
	
		$this->template->build('listing/qualification',$data);
	
	}
	function submit_qualification($profile_id=0)
	{
		
		
		$this->form_validation->set_rules('institute', 'Institute/College', 'required|xss_clean');
		$this->form_validation->set_rules('major_subject', 'Major Subject', 'required|xss_clean ');
		$this->form_validation->set_rules('year', 'Year', 'required|xss_clean');
		
		if ($this->form_validation->run() == true) {
		
		
			$profile_id = $profile_id;
		
			$post_data=array(
		
					'profile_id' => $profile_id,
					'institute' => $this->input->post('institute'),
					'subject' => $this->input->post('major_subject'),
					'year' => $this->input->post('year'),
		
			);
					
			$this->db->insert('qualification',$post_data);
			$this->session->set_flashdata('message', 'Sucessfully!... ');
			redirect('secure/listing/listings/add_qualification/'.$profile_id);
		
		} else {
			$this->session->set_flashdata('message', 'Invalid');
			$this->add_qualification($profile_id);
				
			//redirect('member/qualification');
		}
	}
	
	
	function update_qualification()
	{
	
	
		$this->form_validation->set_rules('institute', 'Institute/College', 'required|xss_clean');
		$this->form_validation->set_rules('major_subject', 'Major Subject', 'required|xss_clean ');
		$this->form_validation->set_rules('year', 'Year', 'required|xss_clean');
	
		if ($this->form_validation->run() == true) {
	
			$id = $this->input->post('id');
			
			$post_data=array(
	
					//'profile_id' =>$profile_id,
					'institute' => $this->input->post('institute'),
					'subject' => $this->input->post('major_subject'),
					'year' => $this->input->post('year'),
	
			);
	
			$this->db->where('id',$id);
			$this->db->update('qualification',$post_data);
			
			$this->session->set_flashdata('message', 'Update Sucessfully!... ');
			redirect('secure/listing/listings/edit_qualification/'.$id);
	
		} else {
			$this->session->set_flashdata('message', 'Invalid');
			redirect('secure/listing/listings/edit_qualification/'.$id);
		}
	}
	
	
	function delete_qualification($id)
	{
		$this->admin_listing_model->deleteQualification($id);
		redirect('secure/listing/listings/');
	}
	
	
	
	
	function add_license($profile_id=0)
	{
		$data['mode'] = "ADD";
	
		$data['licensce'] = $this->admin_listing_model->getLicense($profile_id);
	
		$data['profile_id'] = $profile_id;
	
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
	
		$this->template->build('listing/license',$data);
	
	}
	
	function edit_license($id)
	{
	
			
		$data['mode'] = "EDIT";
	
		$data['license']['info'] = $this->admin_listing_model->getLicenseinof($id);
	
		//$data['profile_id'] = $profile_id;
	
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
	
		$this->template->build('listing/license',$data);
	
	}
	function submit_license($profile_id=0)
	{
	
	
		$this->form_validation->set_rules('state', 'State', 'required|xss_clean');
		$this->form_validation->set_rules('license_status', 'License Status', 'required|xss_clean ');
		$this->form_validation->set_rules('acquired', 'Acquired', 'required|xss_clean');
	
		if ($this->form_validation->run() == true) {
	
	
			$profile_id = $profile_id;
	
			$post_data=array(
	
					'profile_id' => $profile_id,
					'location' => $this->input->post('state'),
					'status' => $this->input->post('license_status'),
					'acquired' => $this->input->post('acquired'),
	
			);
				
			$this->db->insert('license',$post_data);
			$this->session->set_flashdata('message', 'Sucessfully!... ');
			redirect('secure/listing/listings/add_license/'.$profile_id);
	
		} else {
			$this->session->set_flashdata('message', 'Invalid');
			$this->add_license($profile_id);
	
			//redirect('member/qualification');
		}
	}
	
	
	function update_license()
	{
	
	
		$this->form_validation->set_rules('state', 'State', 'required|xss_clean');
		$this->form_validation->set_rules('license_status', 'License Status', 'required|xss_clean ');
		$this->form_validation->set_rules('acquired', 'Acquired', 'required|xss_clean');
		
		if ($this->form_validation->run() == true) {
		
			$id = $this->input->post('id');
					
			$post_data=array(
			
					'location' => $this->input->post('state'),
					'status' => $this->input->post('license_status'),
					'acquired' => $this->input->post('acquired'),
	
			);
	
			$this->db->where('id',$id);
			$this->db->update('license',$post_data);
				
			$this->session->set_flashdata('message', 'Update Sucessfully!... ');
			redirect('secure/listing/listings/edit_license/'.$id);
	
		} else {
			$this->session->set_flashdata('message', 'Invalid');
			redirect('secure/listing/listings/edit_license/'.$id);
		}
	}
	
	
	function delete_license($id)
	{
		$this->admin_listing_model->deleteLicense($id);
		redirect('secure/listing/listings/');
	}
	
	
	function add_association($profile_id=0)
	{
		$data['mode'] = "ADD";
	
		$data['association'] = $this->admin_listing_model->getAssociation($profile_id);
	
		$data['profile_id'] = $profile_id;
	
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
	
		$this->template->build('listing/association',$data);
	
	}
	
	function edit_association($id)
	{
	
			
		$data['mode'] = "EDIT";
	
		$data['association']['info'] = $this->admin_listing_model->getAssociationinof($id);
	
		//$data['profile_id'] = $profile_id;
	
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
	
		$this->template->build('listing/association',$data);
	
	}
	function submit_association($profile_id=0)
	{
	
	
		$this->form_validation->set_rules('position', 'Position', 'required|xss_clean');
		$this->form_validation->set_rules('association', 'Association', 'required|xss_clean ');
		$this->form_validation->set_rules('from_year', 'From Year', 'required|xss_clean');
		$this->form_validation->set_rules('to_year', 'To Year', 'required|xss_clean');
	
		if ($this->form_validation->run() == true) {
	
	
			$profile_id = $profile_id;
	
			$post_data=array(
	
					'profile_id' => $profile_id,
					'position' => $this->input->post('position'),
					'association' => $this->input->post('association'),
					'year_from' => $this->input->post('from_year'),
					'year_to' => $this->input->post('to_year'),
	
			);
	
			$this->db->insert('association',$post_data);
			$this->session->set_flashdata('message', 'Sucessfully!... ');
			redirect('secure/listing/listings/add_association/'.$profile_id);
	
		} else {
			$this->session->set_flashdata('message', 'Invalid');
			$this->add_association($profile_id);
	
			//redirect('member/qualification');
		}
	}
	
	
	function update_association()
	{
	
	
		$this->form_validation->set_rules('position', 'Position', 'required|xss_clean');
		$this->form_validation->set_rules('association', 'Association', 'required|xss_clean ');
		$this->form_validation->set_rules('from_year', 'From Year', 'required|xss_clean');
		$this->form_validation->set_rules('to_year', 'To Year', 'required|xss_clean');
	
		if ($this->form_validation->run() == true) {
	
			$id = $this->input->post('id');
				
			$post_data=array(
						
					'position' => $this->input->post('position'),
					'association' => $this->input->post('association'),
					'year_from' => $this->input->post('from_year'),
					'year_to' => $this->input->post('to_year'),
	
			);
	
			$this->db->where('id',$id);
			$this->db->update('association',$post_data);
	
			$this->session->set_flashdata('message', 'Update Sucessfully!... ');
			redirect('secure/listing/listings/edit_association/'.$id);
	
		} else {
			$this->session->set_flashdata('message', 'Invalid');
			redirect('secure/listing/listings/edit_association/'.$id);
		}
	}
	
	
	function delete_association($id)
	{
		$this->admin_listing_model->deleteAssociation($id);
		redirect('secure/listing/listings/');
	}

	
	function add_awards($profile_id=0)
	{
		$data['mode'] = "ADD";
	
		$data['awards'] = $this->admin_listing_model->getAwards($profile_id);
	
		$data['profile_id'] = $profile_id;
	
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
	
		$this->template->build('listing/awards',$data);
	
	}
	
	function edit_award($id)
	{
	
			
		$data['mode'] = "EDIT";
	
		$data['awards']['info'] = $this->admin_listing_model->getAwardinof($id);
	
		//$data['profile_id'] = $profile_id;
	
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('footer','footer/footer');
	
		$this->template->build('listing/awards',$data);
	
	}
	function submit_award($profile_id=0)
	{
	
	
		$this->form_validation->set_rules('award', 'Award', 'required|xss_clean');
		$this->form_validation->set_rules('organization', 'Organization', 'required|xss_clean ');
		$this->form_validation->set_rules('year', 'Year', 'required|xss_clean');
	
		if ($this->form_validation->run() == true) {
	
	
			$profile_id = $profile_id;
	
			$post_data=array(
	
					'profile_id' => $profile_id,
					'award' => $this->input->post('award'),
					'organization' => $this->input->post('organization'),
					'year' => $this->input->post('year'),
					
			);
	
			$this->db->insert('awards',$post_data);
			$this->session->set_flashdata('message', 'Sucessfully!... ');
			redirect('secure/listing/listings/add_awards/'.$profile_id);
	
		} else {
			$this->session->set_flashdata('message', 'Invalid');
			$this->add_awards($profile_id);
	
			//redirect('member/qualification');
		}
	}
	
	
	function update_award()
	{
	
	
		$this->form_validation->set_rules('award', 'Award', 'required|xss_clean');
		$this->form_validation->set_rules('organization', 'Organization', 'required|xss_clean ');
		$this->form_validation->set_rules('year', 'Year', 'required|xss_clean');
	
		if ($this->form_validation->run() == true) {
	
			$id = $this->input->post('id');
	
			$post_data=array(
	
					'award' => $this->input->post('award'),
					'organization' => $this->input->post('organization'),
					'year' => $this->input->post('year'),
	
			);
	
			$this->db->where('id',$id);
			$this->db->update('awards',$post_data);
	
			$this->session->set_flashdata('message', 'Update Sucessfully!... ');
			redirect('secure/listing/listings/edit_award/'.$id);
	
		} else {
			$this->session->set_flashdata('message', 'Invalid');
			redirect('secure/listing/listings/edit_award/'.$id);
		}
	}
	
	
	function delete_award($id)
	{
		$this->admin_listing_model->deleteAward($id);
		redirect('secure/listing/listings/');
	}
	
	
}